package com.zy.experience_system.util;

import com.zy.experience_system.vo.ResultVO;

public class ResultUtil {
    public static ResultVO success(Object data){
        ResultVO resultVO = new ResultVO();
        resultVO.setStatus(200);
        resultVO.setMsg("成功");
        resultVO.setData(data);
        return resultVO;
    }

    public static ResultVO success(Integer status,String msg,Object data){
        ResultVO resultVO = new ResultVO();
        resultVO.setStatus(status);
        resultVO.setMsg(msg);
        resultVO.setData(data);
        return resultVO;
    }

    public static ResultVO loginSuccess(Object data,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setStatus(200);
        resultVO.setMsg(msg);
        resultVO.setData(data);
        return resultVO;
    }



    public static ResultVO error(String error){
        ResultVO resultVO = new ResultVO();
        resultVO.setStatus(500);
        resultVO.setMsg(error);
        resultVO.setData(null);
        return resultVO;
    }
    public static ResultVO error(Integer status,String error){
        ResultVO resultVO = new ResultVO();
        resultVO.setStatus(status);
        resultVO.setMsg(error);
        resultVO.setData(null);
        return resultVO;
    }
}
